# 作者：位微
# 你不是在写代码而是在解决问题
# 2025年09月17日21时33分25秒
# 2062873410@qq.com
import torch

a=torch.empty(2,3)
print(a)
out=torch.reshape(a,(1,6))
print(out)
print(torch.t(a).shape)
a=torch.rand(1,2,3)
out=torch.transpose(a,0,1)
print(a.shape)
print("out",out.shape)
print(torch.squeeze(out).shape) #将1维的进行压缩
print(torch.unsqueeze(out,-1).shape)# 在最后一行再加上一维
print(out)
print(out.shape)
out1=torch.unbind(a,dim=1)
print(out1)
print(out1[0].shape)
print('*'*100)
print(a)
print(a.shape)
# 先沿0轴反转再沿着1轴进行反转
out=torch.flip(a,dims=[0,1])# 有点不能理解
print(out)
print(out.shape)
print('*'*100)
print(a)
print(a.shape)
out=torch.rot90(a)
print(out)
print(out.shape)
